package share

import (
	"apibe/grpc/rome/v1/share/config"
	"apibe/grpc/rome/v1/share/croner"
	"apibe/grpc/rome/v1/share/db"
	"apibe/grpc/rome/v1/share/logger"
)

type Options struct {
	Path string
	Cron bool
}

func Init(options ...Options) {
	logger.Init()
	for _, opt := range options {
		config.Init(opt.Path)
		if opt.Cron {
			croner.Init()
		}
	}
	db.Init(db.Option{MongoInit: true, RedisInit: true})
}
